package com.carcenter.personnel.controller;

import com.carcenter.common.result.Result;
import com.carcenter.personnel.entity.Roles;
import com.carcenter.personnel.service.IRolesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author car
 * @since 2025-07-16
 */
@RestController
@RequestMapping("/roles")
public class RolesController {

    @Autowired
    IRolesService rolesService;

    @GetMapping("/getRoleList")
    public Result<List<Roles>> getRoleList(){
        List<Roles> roles = rolesService.list();
        return Result.ok(roles);
    }
}
